<%@ taglib prefix="html" uri="http://struts.apache.org/tags-html"%>
<%@ taglib prefix="bean" uri="http://struts.apache.org/tags-bean"%>
<%@ taglib prefix="logic" uri="http://struts.apache.org/tags-logic"%>
<%@ taglib prefix="core" uri="http://java.sun.com/jsp/jstl/core"%>
<%@ taglib prefix="display" uri="http://displaytag.sf.net"%>
<%@ page contentType="text/html;charset=UTF-8" language="java"%>

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="id" lang="id">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title></title> 
</head>
<body> 

	<table width="99%" cellspacing="0" cellpadding="0" border="0">
			<tr>
				<td style="width: 15%;" valign="top">
					<jsp:include page="../common/leftMenu.jsp" />
				</td>

				<td style="width: 83%;" valign="top" >
				
		<div class="outerbox" style="min-width: 600px;">
		<div class="mainHeading">
			<div class=""
				style="width: 240px; height: 32px; background: url(images/formTitleBackground.png) no-repeat top right; font-color: #CC0000;">
				<h2 class="formTitle" >LICENSES</h2>
			</div>
		</div>
	</div>
		
	<!--   ==================================== TABLE ======================================    -->
	<div class="outerbox" style="min-width: 600px;">
		<html:form action="/empLicenseList"> 
			<div class="actionbar_table">
				<div class="formbuttons">
					<logic:equal name="empLicenseList" value="true" property="canAdd">
						<input type="button" class="plainbtn" id="btnAdd" name="btnAdd" value="Add"  onclick="openPopup('empLicenseUpdate.do?act=add&emp_num=<bean:write name="empLicenseList" property="empNumber"/>','Add License','450px','270px')" />
					</logic:equal>
					<logic:equal name="empLicenseList" value="true" property="canDelete">
						<html:submit disabled="true" styleClass="plainbtn" styleId="btnDelete" property="btnDelete" value="Delete" onclick="return confirmButton('btnDelete=clicked','Are you sure you want to delete all the selected items?')"></html:submit>
					</logic:equal>
						Found&nbsp;<bean:write name="empLicenseList" property="totalItems"/>&nbsp;items /&nbsp;
						<bean:write name="empLicenseList" property="totalPage"/>&nbsp;pages.
				</div>

				<br class="clear" />
			</div>
			<br class="clear" />

			<div id="helpText" class="helpText"></div>

			<table
				style="border-collapse: collapse; width: 100%; text-align: left;"
				class="data-table">
				<colgroup align="right">
					<col width="4%" />
					<col width="20%" />
					<col width="20%" />
					<col width="25%" />
					<col width="30%" />
				</colgroup>

				<thead>
					<tr>
						<logic:equal name="empLicenseList" value="true" property="canDelete">
							<th rowspan="1"><input type="checkbox" id="checkAll"  onclick="setCheckAll()" name="chkSelectAll" value=""/></th>
						</logic:equal>
						<logic:notEqual name="empLicenseList" value="true" property="canDelete">
							<th rowspan="1"></th>
						</logic:notEqual>
						<th style="text-align: left" rowspan="1"><a	href="empLicenseList.do?sort=licenseType" title="Sort by License Type" class="null">License Type</a></th>
						<th style="text-align: left" rowspan="1"><a	href="empLicenseList.do?sort=licenseNo" title="Sort by License No." class="null">License No.</a></th>
						<th style="text-align: left" rowspan="1"><a	href="empLicenseList.do?sort=issuedDate" title="Sort by Issued Date" class="null">Issued Date</a></th>
						<th style="text-align: left" rowspan="1"><a	href="empLicenseList.do?sort=expiryDate" title="Sort by Expiry Date" class="null">Expiry Date</a></th>
					</tr>
				</thead>

				<tbody>					
					<logic:iterate id="allLicenses" name="empLicenseList" property="allLicenses" scope="session" indexId="counter">
						<tr class='<%= counter.intValue()%2 == 0 ? "even" : "odd" %>' >
							<logic:equal name="empLicenseList" value="true" property="canDelete">
								<td class="left"><html:checkbox styleClass="tableCheckBox" onclick="disableCheckAll()" name="allLicenses" property="isSelected" indexed="true"/></td>
							</logic:equal>
							<logic:notEqual name="empLicenseList" value="true" property="canDelete">
								<td class="left"></td>
							</logic:notEqual>
							<logic:equal name="empLicenseList" value="true" property="updatable">
								<td class="left"><a href="javascript:openPopup('empLicenseUpdate.do?act=edit&id=<bean:write name="allLicenses" property="id"/>&emp_num=<bean:write name="empLicenseList" property="empNumber"/>','Edit License','450px','270px')" /><bean:write name="allLicenses" property="licenseType"/></td>
							</logic:equal>
							<logic:equal name="empLicenseList" value="false" property="updatable">
								<td class="left"><bean:write name="allLicenses" property="licenseType"/></td>
							</logic:equal>
							<td class="left"><bean:write name="allLicenses" property="licenseNo"/></td>
							<td class="left"><bean:write name="allLicenses" property="issuedDate"/></td>
							<td class="left"><bean:write name="allLicenses" property="expiryDate"/></td>
						</tr>
					</logic:iterate>
				</tbody>
			</table>
			
			<div id="pageListId" style="margin-right: 10px;margin-bottom: 4px;margin-top: 4px;">
				<logic:iterate id="pageListId" name="empLicenseList" property="listPages" indexId="counter">
					<logic:equal name="pageListId" value="false" property="isCurrent">
						<a style="color: black; font-weight: bold; margin-left: 5px; font-size: 12px;" href="empLicenseList.do?page=<bean:write name="pageListId" property="value"/>"><bean:write name="pageListId" property="label"/></a>
					</logic:equal>
					<logic:notEqual name="pageListId" value="false" property="isCurrent">
						<a style="color: red; font-weight: bold; margin-left: 5px; font-size: 13px;"><bean:write name="pageListId" property="label"/></a>
					</logic:notEqual>
				</logic:iterate>
			</div> 
		</html:form>
	</div>
	</td>
	</tr>
	</table>
</body>
</html>